export type User = {
  name: string;
  color: string;
};

export const cursorRender = (user: User) => {
  // 包裹整个光标显示的容器
  const container = document.createElement("div");
  container.className = "collab-cursor-container";

  // 光标条（小竖线）
  const cursor = document.createElement("div");
  cursor.className = "collab-cursor";
  cursor.style.backgroundColor = user.color;

  // 名字标签
  const label = document.createElement("div");
  label.className = "collab-cursor-label";
  label.textContent = user.name;
  label.style.backgroundColor = user.color;

  container.appendChild(cursor);
  container.appendChild(label);

  return container;
};
